package com.example.demo.utils;

import lombok.extern.slf4j.Slf4j;

/**
 * @ClassName moreline
 * @Description TODO
 * Author yangqinglin
 * @Date 2021/1/21 19:26
 * @Version
 **/
@Slf4j(topic = "moreline")
public class moreline {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            log.info("洗水壶");

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            log.info("烧开水");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        },"小王");
        t1.start();


        Thread t2=new Thread(()->{
            log.debug("洗杯子");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("洗茶壶");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("拿茶叶");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("泡茶");


        },"老李");

        t2.start();
    }
}
